<?
  require_once("../inc/keywords.php");
  
  if(isset($_GET['id']))
  {
  	$keyword = getKeyword($_GET['id']);
	$keyword = html_input_treatment($keyword);

  }
  if(isset($_POST['id']))
  {
  	$results = delKeyword($_POST['id']);
	
	if($results === true)
	{
		header("location:index.php?deleted");
	}
	else
	{
		print_r($results);
		die();
	}
  }


?>

<!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title><?=$title ?> Delete Keyword</title>
         <? require('../inc/header-info.php'); ?>
    </head>
    <body>
        <div class="container">
            <? include('../inc/nav.php'); ?>
           <h4>Delete Keyword</h4>
           <form id="delete-form" method="post" action="delete.php">
             	
            	<input type="hidden" name="id" value='<?=$keyword['id']?>'>
            	<h5>Confirm the deletion of the following item:</h5>
            		<dl>
  						<dt>Keyword:</dt>
  						<dd><?=$keyword['value']?></dd>
					</dl>
					
            	<div class="form-actions">
  					<button type="submit" class="btn btn-primary">Delete Keyword</button>
					<a class="btn" href="<?=$url?>keyword/index.php">Cancel</a>
				</div>
            </form>  			
		</div>
	
	</body>
</html>